<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     
  
$id=isset($_GET["id"])?$_GET["id"]:"0";
if($id!="0"){
    $dept=$T->db->query("select * from sys_department where id=".$id)->fetch(PDO::FETCH_ASSOC);
    $T->Set("deptname",$dept["deptname"]);
    $T->Set("odx",$dept["odx"]);
    $T->Set("fg",$dept["flag"]);
    $T->Set("stype",$dept["depttype"]);
    $T->Set("smech",$dept["mech"]);
    $T->Set("id",$dept["id"]);
}else{
    $T->Set("stype","");
    $T->Set("smech","");
    $T->Set("fg","0");
}
        

$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 